<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Pinoytuner_model extends CI_Model {

	function get_featured_content()
	{
	 return $this->db
				 ->where('intFeatured >',0)
				 ->order_by('intFeatured','desc')
				 ->limit(10)
				 ->get('tb_mas_content')
				 ->result_array();
	}
	
	function fetch_single_content($id)
	{						
		$data =  $this->db												
						->get_where('tb_mas_content',array('intID'=>$id,'enumEnabled'=>'enabled'))
						->result_array();
						
		return current($data);
	}
    
	function fetch_community_feeds($cid,$limit=4,$offset=0)
	{
		$cid = get_community_id($cid);
		$data =  $this->db
						->limit($limit,$offset)
						->order_by('dteStart desc')
						->get_where('tb_mas_content',array('fk-tb_mas_community'=>$cid,'enumEnabled'=>'enabled','fk-tb_mas_content_types !='=>5))
						->result_array();
    
						
		return $data;
	}

}
